package com.fsy.its.netty.gbt.encoder;

import com.fsy.its.netty.config.GbtEncoder;
import com.fsy.its.netty.msg.QingdaoHeartMsg;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;

@GbtEncoder
//TODO: 青岛用传测试代码，正式代码不用
public class GbtQingdaoHeartMsgEncoder extends GbtMessageEncoder<QingdaoHeartMsg> {

    @Override
    protected void doEncode(ChannelHandlerContext ctx, QingdaoHeartMsg msg, ByteBuf out) {
        out.writeByte(msg.dataType);
        out.writeByte(0);
        out.writeBytes(msg.data);
    }
}
